<script type="text/javascript" >

    function ShowRecordDetail(this_ele,session_id){
        //console.log(session_id);

        $.getJSON('/api/audit/cmd_logs/',{session_id: session_id},function(callback){
            console.log(callback)
            var html_ele = ''
            $.each(callback.data,function(index,item){
                html_ele += "<div class='row'><div class='col-md-3'><span>" + item.date + "</span></div><div class='col-md-9'><span >" + item.cmd +"</span></div></div>";
                //console.log(item)
            });
            $("#cmd_log_content").html(html_ele);
            var tr_ele = $(this_ele).parent().parent();
            var hostname = tr_ele.children("td[data-label='hostname']").text();
            var ip_addr = tr_ele.children("td[data-label='ip_addr']").text();
            var username = tr_ele.children("td[data-label='username']").text();
            var login_date = tr_ele.children("td[data-label='login_date']").text();
            var logout_date = tr_ele.children("td[data-label='logout_date']").text();

            $("#modal-username span").text(username);
            $("#modal-hostname span").text(hostname + "("+ ip_addr +")");
            $("#modal-login-date span").text(login_date);
            $("#modal-logout-date span").text(logout_date);
        });//end getJSON
        $("#cmd-record-modal").modal('show');

    }
</script>